﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/naija.Master" CodeBehind="Home.aspx.vb" Inherits="WebApplication11.WebForm5" 
    title="NaijaTradStyles-Find Styles" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="naija.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="Label1" runat="server" Text="Search for Style by Category:"></asp:Label>
&nbsp;<asp:DropDownList ID="Category" runat="server" AutoPostBack="True" 
    DataSourceID="AccessDataSource1" DataTextField="CatName" DataValueField="ID" 
        ToolTip="Choose Style category">
    <asp:ListItem Selected="True" Value="1">---Select Category---</asp:ListItem>
        <asp:ListItem></asp:ListItem>
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" 
    DataFile="~/App_Data/pictures.mdb" 
    SelectCommand="SELECT [ID], [CatName], [Descirption] FROM [Categories]">
</asp:AccessDataSource>
<asp:DropDownList ID="DropDownList1" runat="server" 
    DataSourceID="AccessDataSource2" DataTextField="StyleName" 
    DataValueField="CategoryID" ToolTip="Choose Style type">
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource2" runat="server" 
    DataFile="~/App_Data/pictures.mdb" 
    SelectCommand="SELECT [CategoryID], [ID], [StyleName] FROM [Style] WHERE ([CategoryID] = ?)">
    <SelectParameters>
        <asp:ControlParameter ControlID="Category" Name="CategoryID" 
            PropertyName="SelectedValue" Type="Int32" />
    </SelectParameters>
</asp:AccessDataSource>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server">
</asp:ObjectDataSource>
<asp:DropDownList ID="Ethnic" runat="server" DataSourceID="AccessDataSource3" 
    DataTextField="EthnicName" DataValueField="ID" ToolTip="Select Ethnic Group">
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource3" runat="server" 
    DataFile="~/App_Data/pictures.mdb" 
    SelectCommand="SELECT [ID], [EthnicName] FROM [Ethnic]">
</asp:AccessDataSource>
<asp:DropDownList ID="DropDownList2" runat="server" 
    DataSourceID="AccessDataSource4" DataTextField="GenderName" 
        DataValueField="ID" ToolTip="Select Gender">
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource4" runat="server" 
    DataFile="~/App_Data/pictures.mdb" 
    SelectCommand="SELECT [ID], [GenderName] FROM [Gender]">
</asp:AccessDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        
        SelectCommand="SELECT [ProfileImage], [ID], [Category], [Style], [Gender], [Ethnic], [Description], [PicTitle], [TodayDate], [UserName] FROM [UsersUpload]">
    </asp:SqlDataSource>
                <asp:Button ID="Button1" runat="server" Text="Find Style" 
        BackColor="#FF3399" BorderColor="#FF0066" ForeColor="White" Height="20px" 
        Width="101px" />

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="NaijaDb" 
        EmptyDataText="There are no data records to display." AllowPaging="True" 
        AllowSorting="True" BorderColor="White" BorderStyle="None">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="ID" ShowHeader="False" Visible="False" />
            <asp:BoundField DataField="UserName" HeaderText="Designer" 
                SortExpression="UserName" />
            <asp:ImageField  DataImageUrlField="ProfileImage" HeaderText="Style Picture">
            </asp:ImageField>
            <asp:BoundField DataField="TodayDate" HeaderText="Date Uploaded" 
                SortExpression="TodayDate" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="Details2.aspx?field={0}" Text="Discuss" 
                NavigateUrl="~/Details2.aspx" />
        </Columns>
    </asp:GridView>

    <asp:SqlDataSource ID="NaijaDb" runat="server" 
        ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=&quot;C:\Users\T M HUSMAN\Documents\Visual Studio 2008\Projects\WebApplication11(7)\App_Data\pictures1.accdb&quot;" 
        ProviderName="System.Data.OleDb" 
        
        SelectCommand="SELECT [ID], [Category], [Style], [Gender], [Ethnic], [Description], [TodayDate], [PicTitle], [ProfileImage], [UserName] FROM [UsersUpload]">
    </asp:SqlDataSource>
    
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="ID" 
        DataSourceID="NaijaDb" GroupItemCount="3">
        <EmptyItemTemplate>
            <td runat="server" />
            </EmptyItemTemplate>
            <ItemTemplate>
                <td runat="server" style="background-color:#DCDCDC;color: #000000;">
                                 
                    <asp:Image ID="Image1" runat="server" DataImageUrlField='<%# Eval("ProfileImage")%>'/><br />
                    
                    <asp:Label ID="DescriptionLabel" runat="server" 
                        Text='<%# Eval("Description") %>' />
                    <br />
                   
                    <asp:Label ID="TodayDateLabel" runat="server" Text='<%# Eval("TodayDate") %>' />
                    <br />
                   
                    <asp:Label ID="PicTitleLabel" runat="server" Text='<%# Eval("PicTitle") %>' />
                   
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
                </td>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <td runat="server" style="background-color:#FFF8DC;">
                           
                    <asp:Image ID="Image1" runat="server" DataImageUrlField="ProfileImage"/><br />
                    
                    <asp:Label ID="DescriptionLabel" runat="server" 
                        Text='<%# Eval("Description") %>' />
                    <br />
                   
                    <asp:Label ID="TodayDateLabel" runat="server" Text='<%# Eval("TodayDate") %>' />
                    <br />
                   
                    <asp:Label ID="PicTitleLabel" runat="server" Text='<%# Eval("PicTitle") %>' />
                   
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
                </td>
            </AlternatingItemTemplate>
            <EmptyDataTemplate>
                <table runat="server" 
                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                    <tr>
                        <td>
                            No data was returned.</td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <td runat="server" style="">
                    Category:
                    <asp:TextBox ID="CategoryTextBox" runat="server" 
                        Text='<%# Bind("Category") %>' />
                    <br />
                    Style:
                    <asp:TextBox ID="StyleTextBox" runat="server" Text='<%# Bind("Style") %>' />
                    <br />
                    Gender:
                    <asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
                    <br />
                    Ethnic:
                    <asp:TextBox ID="EthnicTextBox" runat="server" Text='<%# Bind("Ethnic") %>' />
                    <br />
                    Description:
                    <asp:TextBox ID="DescriptionTextBox" runat="server" 
                        Text='<%# Bind("Description") %>' />
                    <br />
                    TodayDate:
                    <asp:TextBox ID="TodayDateTextBox" runat="server" 
                        Text='<%# Bind("TodayDate") %>' />
                    <br />
                    PicTitle:
                    <asp:TextBox ID="PicTitleTextBox" runat="server" 
                        Text='<%# Bind("PicTitle") %>' />
                    <br />
                    ProfileImage:
                    <asp:TextBox ID="ProfileImageTextBox" runat="server" 
                        Text='<%# Bind("ProfileImage") %>' />
                    <br />
                    UserName:
                    <asp:TextBox ID="UserNameTextBox" runat="server" 
                        Text='<%# Bind("UserName") %>' />
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <br />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                    <br />
                </td>
            </InsertItemTemplate>
            <LayoutTemplate>
                <table runat="server">
                    <tr runat="server">
                        <td runat="server">
                            <table ID="groupPlaceholderContainer" runat="server" border="1" 
                                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                <tr ID="groupPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td runat="server" 
                            style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                            <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                        ShowLastPageButton="True" />
                                </Fields>
                            </asp:DataPager>
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <EditItemTemplate>
                <td runat="server" style="background-color:#008A8C;color: #FFFFFF;">
                    ID:
                    <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
                    <br />
                    Category:
                    <asp:TextBox ID="CategoryTextBox" runat="server" 
                        Text='<%# Bind("Category") %>' />
                    <br />
                    Style:
                    <asp:TextBox ID="StyleTextBox" runat="server" Text='<%# Bind("Style") %>' />
                    <br />
                    Gender:
                    <asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
                    <br />
                    Ethnic:
                    <asp:TextBox ID="EthnicTextBox" runat="server" Text='<%# Bind("Ethnic") %>' />
                    <br />
                    Description:
                    <asp:TextBox ID="DescriptionTextBox" runat="server" 
                        Text='<%# Bind("Description") %>' />
                    <br />
                    TodayDate:
                    <asp:TextBox ID="TodayDateTextBox" runat="server" 
                        Text='<%# Bind("TodayDate") %>' />
                    <br />
                    PicTitle:
                    <asp:TextBox ID="PicTitleTextBox" runat="server" 
                        Text='<%# Bind("PicTitle") %>' />
                    <br />
                    ProfileImage:
                    <asp:TextBox ID="ProfileImageTextBox" runat="server" 
                        Text='<%# Bind("ProfileImage") %>' />
                    <br />
                    UserName:
                    <asp:TextBox ID="UserNameTextBox" runat="server" 
                        Text='<%# Bind("UserName") %>' />
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <br />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                    <br />
                </td>
            </EditItemTemplate>
            <GroupTemplate>
                <tr ID="itemPlaceholderContainer" runat="server">
                    <td ID="itemPlaceholder" runat="server">
                    </td>
                </tr>
            </GroupTemplate>
            <SelectedItemTemplate>
                <td runat="server" 
                    style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
                    ID:
                    <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                    <br />
                    Category:
                    <asp:Label ID="CategoryLabel" runat="server" Text='<%# Eval("Category") %>' />
                    <br />
                    Style:
                    <asp:Label ID="StyleLabel" runat="server" Text='<%# Eval("Style") %>' />
                    <br />
                    Gender:
                    <asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' />
                    <br />
                    Ethnic:
                    <asp:Label ID="EthnicLabel" runat="server" Text='<%# Eval("Ethnic") %>' />
                    <br />
                    Description:
                    <asp:Label ID="DescriptionLabel" runat="server" 
                        Text='<%# Eval("Description") %>' />
                    <br />
                    TodayDate:
                    <asp:Label ID="TodayDateLabel" runat="server" Text='<%# Eval("TodayDate") %>' />
                    <br />
                    PicTitle:
                    <asp:Label ID="PicTitleLabel" runat="server" Text='<%# Eval("PicTitle") %>' />
                    <br />
                    ProfileImage:
                    <asp:Label ID="ProfileImageLabel" runat="server" 
                        Text='<%# Eval("ProfileImage") %>' />
                    <br />
                    UserName:
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
                </td>
            </SelectedItemTemplate>
        </asp:ListView>
        <br />
    
</asp:Content>
